package com.morty.config;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.morty.jwt.JwtTokenFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.gateway.filter.GlobalFilter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.RedisTemplate;

/**
 * @Author:
 * @Date:
 * @Description:
 */
@Configuration
public class FilterRegister {
	@Autowired
	private ObjectMapper objectMapper;

	@Autowired
	private RedisTemplate redisTemplate;
	@Bean
	public GlobalFilter tokenFilter() {
		return new JwtTokenFilter(objectMapper, redisTemplate);
	}
}
